		TITLE	HEXWOUT - Copyright (c) SLR Systems 1994

		INCLUDE MACROS

		PUBLIC	HEXDWOUTSH


		.DATA

		EXTERNDEF	HEXTBL:BYTE


		.CODE	PASS2_TEXT


HEXDWOUTSH	PROC
		;
		;OUTPUT EAX WITH LEADING ZEROS SUPPRESSED
		;
		PUSH	EBX
		XOR	ECX,ECX

		MOV	EBX,OFF HEXTBL
		PUSH	EAX

		SHR	EAX,16
		CALL	HEXWOUTS

		POP	EAX
		CALL	HEXWOUTS

		OR	CL,CL
		JZ	L1$

		MOV	BPTR [EDI],'H'

		POP	EBX
		INC	EDI

		RET

L1$:
		MOV	WPTR [EDI],'H0'

		POP	EBX
		ADD	EDI,2

		RET

HEXDWOUTSH	ENDP


HEXWOUTS	PROC
		;
		;
		;
		PUSH	EAX
		MOV	AL,AH

		CALL	HEXBOUT

		POP	EAX
HEXBOUT:
		PUSH	EAX

		SHR	AL,4
		CALL	HNIBBLE

		POP	EAX
HNIBBLE:
		AND	EAX,0FH
		JZ	HEX0

		MOV	AL,[EBX+EAX]
		MOV	CL,30H

		MOV	[EDI],AL
		INC	EDI

		RET

HEX0:
		OR	CL,CL
		JZ	L9$

		MOV	[EDI],CL
		INC	EDI
L9$:
		RET

HEXWOUTS	ENDP


		END

